package com.sg.controller.pbff;

import com.sg.service.biz.pbff.TargetCycleService;
import com.sg.dto.biz.pbff.req.*;
import com.sg.dto.biz.pbff.res.*;
import com.sg.common.ro.OkrResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ：
 * @version 1.0
 * @date ：
 */
@Api(value = "TargetCycle", tags = {"TargetCycle"})
@RestController
// @RequestMapping("/poms/targetCycle/")
public class TargetCycleController {

    @Autowired
    TargetCycleService targetCycleService;

    /**
     * B3批量查询中基层校验观测点(管理)
     * gen by moon at 11/7/2022, 12:25:34 AM
     */
    @PostMapping("/oms/mgt/targetCycle/batchQueryMidBasicCheckTarget")
    @ApiOperation(value = "B3批量查询中基层校验观测点(管理)", response = OkrResult.class)
    public OkrResult<BffBatchQueryMidBasicCheckTargetRespDto> batchQueryMidBasicCheckTarget(@RequestBody(required = false) @Validated BffBatchQueryMidBasicCheckTargetReqDto reqDTO) {
        return OkrResult.success(targetCycleService.batchQueryMidBasicCheckTarget(reqDTO));
    }

    /**
     * B3查询表格横向目标周期列表(管理)
     * gen by moon at 11/7/2022, 12:25:35 AM
     */
    @PostMapping("/oms/mgt/targetCycle/queryFormHorizontalTargetPeriodList")
    @ApiOperation(value = "B3查询表格横向目标周期列表(管理)", response = OkrResult.class)
    public OkrResult<BffQueryFormHorizontalTargetPeriodListRespDto> queryFormHorizontalTargetPeriodList(@RequestBody(required = false) @Validated BffQueryFormHorizontalTargetPeriodListReqDto reqDTO) {
        return OkrResult.success(targetCycleService.queryFormHorizontalTargetPeriodList(reqDTO));
    }

    /**
     * B3-更新执行周期阶段时段规则
     * gen by moon at 12/29/2022, 12:58:50 PM
     */
    @PostMapping("/oms/targetCycle/refreshExecuteCycleStageTimingRule")
    @ApiOperation(value = "B3-更新执行周期阶段时段规则", response = OkrResult.class)
    public OkrResult<BffRefreshExecuteCycleStageTimingRuleRespDto> refreshExecuteCycleStageTimingRule(@RequestBody(required = false) @Validated BffRefreshExecuteCycleStageTimingRuleReqDto reqDTO) {
        return OkrResult.success(targetCycleService.refreshExecuteCycleStageTimingRule(reqDTO));
    }
}
